export default function (url) {
  const query = {}
  let matches = url.match(/\?(.[^#]*)/)
  if (!matches) return null
  
  const queryList = matches[1].split('&')
  
  for (let i = 0, len = queryList.length; i < len; i++) {
      
    matches = queryList[i].match(/(.[^=]+)=(.+)/)
    if(!matches) continue
    query[matches[1]] = matches[2]
  }

  return query
}